<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        // let
        var arr1=[1,"ok",3];
        var arr2=["ok2",4];
        // 1  "ok" 3   "ok2"  4

    //    var newarr3= arr1.concat(arr2);
    //    console.log(newarr3)

    //  ...扩展运算符
    var  arr3=[...arr1,...arr2];
    console.log(arr3)


    // 对象
    var  obj={
        name:"jack",
        age:18,
        hobby:"篮球",
        sex:1,
        major:"计算机"

    }

    let {
        name,
        major
    }={...obj};
    console.log(name,major)


    // var  name=obj.name;
    // var  age=obj.age;
    // var  hobby=obj.hobby;
    // var  sex=obj.sex;
    // var  major=obj.major;

    // console.log(name,age,hobby,sex,major)
    </script>
</body>
</html>